#include<iostream>
#include<fstream>
#include "widget.h"
#include "ui_widget.h"
#include<string.h>
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    std::ifstream file("E:/code_commit/qt/comboBox_1/config.txt");
    std::string line;
    while(std::getline(file,line))
    {
        ui->comboBox->addItem(QString::fromStdString(line));
    }
    file.close();
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    qDebug()<<ui->comboBox->currentText();
}
